package com.sina.medical.domain.user;

import com.sina.medical.core.domain.Domain;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.management.Query;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.time.LocalDateTime;


/**
 * 用户实体
 */

@Entity
@Table(name = "u_info")
@DynamicInsert
@DynamicUpdate
public class User extends Domain {


    public User() {
    }

    public User(Integer id) {
        this.id = id;
    }


    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @NotNull(groups = {Query.class})
    private Integer id;

    @Column(name = "create_time", updatable = false)
    private LocalDateTime createTime;

    @Column(name = "name")
    private String name;

    @Column(name = "mail_box")
    private String mailBox;

    @Column(name = "pwd")
    private String pwd;

    @Column(name = "gender")
    private Gender gender;

    @Column(name = "address")
    private String address;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getMailBox() {
        return mailBox;
    }

    public void setMailBox(String mailBox) {
        this.mailBox = mailBox;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pPwd) {
        this.pwd = pwd;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }
}
